﻿<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="EIT Surfer Infinity 0.4 beta (NOT FOR MEDICAL USE)" Height="667" Width="989" xmlns:my="clr-namespace:ControlerLib;assembly=ControlerLib"  Closing="Window_Closing" Loaded="Window_Loaded" Focusable="False" Icon="/EITSurferInfinity;component/Images/eiti64.png">
    <Window.Resources>
        <Style x:Key="MyFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Control}">
                        <Grid Margin="3 2">
                            <Rectangle Name="r1" StrokeThickness="1" Stroke="Black" StrokeDashArray="2 2"/>
                            <Border Name="border" Width="{TemplateBinding ActualWidth}" Height="{TemplateBinding ActualHeight}"  CornerRadius="2" BorderThickness="1" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            </Style>


            <Style x:Key="ShadowStyle">
                <Setter Property="Control.Foreground" Value="LightGray" />
            </Style>

            <Style x:Key="InformButton" TargetType="Button">
                <Setter Property="OverridesDefaultStyle" Value="True"/>
                <Setter Property="Margin" Value="2"/>
                <Setter Property="FontFamily" Value="Verdana"/>     
                <Setter Property="FontSize" Value="11px"/>
                <Setter Property="FontWeight" Value="Bold"/>
                <Setter Property="FocusVisualStyle" Value="{StaticResource MyFocusVisual}" />
      
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Button">
                        
                        <Border Name="border" 
				BorderThickness="1"
				Padding="4,2" 
				BorderBrush="DarkGray" 
				CornerRadius="3" 
                                    MinHeight="16"
                                    MinWidth="16"
                                    MaxHeight="64"
                                    MaxWidth="64"
                                    
				Background="{TemplateBinding Background}">
                                <Grid>
                                    <ContentPresenter HorizontalAlignment="Center" 
                                                      
	                           VerticalAlignment="Center" Name="contentShadow" 
					Style="{StaticResource ShadowStyle}">
                                        <ContentPresenter.RenderTransform>
                                            <TranslateTransform X="1.0" Y="1.0" />
                                        </ContentPresenter.RenderTransform>
                                    </ContentPresenter>
                                    <ContentPresenter HorizontalAlignment="Center" 
                            VerticalAlignment="Center" Name="content"/>
                                </Grid>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="border" Property="BorderBrush" Value="Orange" />

                                <Setter Property="Foreground" Value="SlateBlue" />
                                </Trigger>
                                <Trigger Property="IsPressed" Value="True">
                                    
                                </Trigger>
                                <Trigger Property="IsDefaulted" Value="True">
                                    <Setter TargetName="border" Property="BorderBrush" Value="#FF282828" />
                                </Trigger>
                                <Trigger Property="IsFocused" Value="True">
                                    <Setter TargetName="border" Property="BorderBrush" Value="#FF282828" />
                                </Trigger>
                                <Trigger Property="IsEnabled" Value="False">
                                    <Setter TargetName="border" Property="Opacity" Value="0.7" />
                                    <Setter Property="Foreground" Value="Gray" />
                                </Trigger>

                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
    </Window.Resources>
    <Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Focusable="False">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="64*" />
            <ColumnDefinition Width="500*" />
            <ColumnDefinition Width="200*" />
        </Grid.ColumnDefinitions>
        
        <Grid HorizontalAlignment="Stretch"  Name="grid1" VerticalAlignment="Stretch" Grid.Column="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="100*" />
                <RowDefinition Height="100*" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="100*" />
                <ColumnDefinition Width="100*" />
            </Grid.ColumnDefinitions>

            <my:ZedGraphWPF  Grid.Column="0" Grid.Row="0" Name="zedGraphWPF1" VerticalAlignment="Stretch"  HorizontalAlignment="Stretch"/>
            <my:ZedGraphWPF  Grid.Column="1" Grid.Row="0" Name="zedGraphWPF2" VerticalAlignment="Stretch"  HorizontalAlignment="Stretch"/>
            <my:ZedGraphWPF  Grid.Column="0" Grid.Row="1" Name="zedGraphWPF3" VerticalAlignment="Stretch"  HorizontalAlignment="Stretch"/>
            <my:ZedGraphWPF  Grid.Column="1" Grid.Row="1" Name="zedGraphWPF4" VerticalAlignment="Stretch"  HorizontalAlignment="Stretch"/>
        </Grid>
        
        <Grid  Name="grid2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
            <Grid.RowDefinitions>
                <RowDefinition Height="64" MinHeight="32"/>
                <RowDefinition Height="32*"/>
                <RowDefinition Height="32*" />
                <RowDefinition Height="32*" />
                <RowDefinition Height="32*" />
                <RowDefinition Height="32*" />
                <RowDefinition Height="32*" />
                <RowDefinition Height="32*" />
                <RowDefinition Height="32*" />
                <RowDefinition Height="32*" />
                <RowDefinition Height="32*" />
                <RowDefinition Height="32*" />    
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="32*" MinWidth="32"/>
                <ColumnDefinition Width="32*" MinWidth="32"/>
            </Grid.ColumnDefinitions>
            <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Content="0" Height="64" HorizontalAlignment="Stretch" Name="labelFrameCounter" VerticalAlignment="Stretch"  FontSize="32" FontWeight="Bold" />
            <Button Grid.Row="1" Style="{DynamicResource InformButton}" Name="buttonProgramParam" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Click="buttonProgramParam_Click" BorderBrush="{x:Null}" Foreground="{x:Null}" DataContext="{Binding}">
                <Button.Background>
                    <ImageBrush RenderOptions.EdgeMode="Aliased" RenderOptions.BitmapScalingMode="HighQuality" ImageSource="/EITSurferInfinity;component/Icons/start64.png" />
                </Button.Background>
            </Button>
            <Button Grid.Row="5" BorderBrush="{x:Null}" DataContext="{Binding}" Foreground="{x:Null}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Name="button1" Style="{DynamicResource InformButton}"  Click="buttonHWSettings_Click" ToolTip="Opens Settings Dialog">
                <Button.Background>
                    <ImageBrush  RenderOptions.EdgeMode="Aliased" RenderOptions.BitmapScalingMode="HighQuality" ImageSource="/EITSurferInfinity;component/Icons/settings64.png" />
                </Button.Background>
            </Button>
            <Button Grid.Row="3" Click="GetInfo_Click" BorderBrush="{x:Null}" DataContext="{Binding}" Foreground="{x:Null}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Name="button2" Style="{DynamicResource InformButton}" ToolTip="Get Device Information" >
                <Button.Background>
                    <ImageBrush ImageSource="/EITSurferInfinity;component/Icons/info64.png" RenderOptions.BitmapScalingMode="HighQuality" RenderOptions.EdgeMode="Aliased" />
                </Button.Background>
            </Button>
            <Button Grid.Row="4" Click="buttonTest_Click" BorderBrush="{x:Null}" DataContext="{Binding}" Foreground="{x:Null}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Name="button3" Style="{DynamicResource InformButton}" ToolTip="Get All Parameters" >
                <Button.Background>
                    <ImageBrush ImageSource="/EITSurferInfinity;component/Icons/getsettings64.png" RenderOptions.BitmapScalingMode="HighQuality" RenderOptions.EdgeMode="Aliased" />
                </Button.Background>
            </Button>
            <Button Grid.Row="2" Click="buttonRaw_Click" BorderBrush="{x:Null}" DataContext="{Binding}" Foreground="{x:Null}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Name="button4" Style="{DynamicResource InformButton}" ToolTip="Take a Raw Snap Shot" >
                <Button.Background>
                    <ImageBrush ImageSource="/EITSurferInfinity;component/Icons/rawsnap64.png" RenderOptions.BitmapScalingMode="HighQuality" RenderOptions.EdgeMode="Aliased" />
                </Button.Background>
            </Button>
            <Button Grid.Row="6" BorderBrush="{x:Null}" DataContext="{Binding}" Foreground="{x:Null}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Name="button7" Style="{DynamicResource InformButton}"  Click="buttonReconstruction_Click" ToolTip="Opens Image Reconstruction Window">
                <Button.Background>
                    <ImageBrush  RenderOptions.EdgeMode="Aliased" RenderOptions.BitmapScalingMode="HighQuality" ImageSource="/EITSurferInfinity;component/Icons/openimage64.png" />
                </Button.Background>
            </Button>
            <Button Grid.Row="7" BorderBrush="{x:Null}" DataContext="{Binding}" Foreground="{x:Null}" Name="buttonIconDisconnect" Style="{DynamicResource InformButton}"   ToolTip="Disconnect the hardware" Click="buttonIconDisconnect_Click">
                <Button.Background>
                    <ImageBrush  RenderOptions.EdgeMode="Aliased" RenderOptions.BitmapScalingMode="HighQuality" ImageSource="/EITSurferInfinity;component/Icons/disconnect64.png" />
                </Button.Background>
            </Button>

            <Button Grid.Row="8" BorderBrush="{x:Null}" DataContext="{Binding}" Foreground="{x:Null}" Name="buttonIconStartDefault" Style="{DynamicResource InformButton}"   ToolTip="Start with Default Settings" Click="buttonStart_Click">
                <Button.Background>
                    <ImageBrush  RenderOptions.EdgeMode="Aliased" RenderOptions.BitmapScalingMode="HighQuality" ImageSource="/EITSurferInfinity;component/Icons/default64.png" />
                </Button.Background>
            </Button>

            <Button Grid.Row="9" BorderBrush="{x:Null}" DataContext="{Binding}" Foreground="{x:Null}" Name="buttonIconClear" Style="{DynamicResource InformButton}"   ToolTip="Clear Graphs History"  Click="button6_Click">
                <Button.Background>
                    <ImageBrush  RenderOptions.EdgeMode="Aliased" RenderOptions.BitmapScalingMode="HighQuality" ImageSource="/EITSurferInfinity;component/Icons/cleargraph64.png" />
                </Button.Background>
            </Button>

            <Button Grid.Row="10" BorderBrush="{x:Null}" DataContext="{Binding}" Foreground="{x:Null}" Name="buttonIconProtocol" Style="{DynamicResource InformButton}"   ToolTip="Open Protocol Windows"  Click="buttonProtocol_Click">
                <Button.Background>
                    <ImageBrush  RenderOptions.EdgeMode="Aliased" RenderOptions.BitmapScalingMode="HighQuality" ImageSource="/EITSurferInfinity;component/Icons/protocol64.png" />
                </Button.Background>
            </Button>

            <Button Grid.Row="11" BorderBrush="{x:Null}" DataContext="{Binding}" Foreground="{x:Null}" Name="buttonIconEnableRecord" Style="{DynamicResource InformButton}"   ToolTip="Enables Data Recording" Click="buttonEnableRecord_Click">
                <Button.Background>
                    <ImageBrush  RenderOptions.EdgeMode="Aliased" RenderOptions.BitmapScalingMode="HighQuality" ImageSource="/EITSurferInfinity;component/Icons/record64.png" />
                </Button.Background>
            </Button>
            <Button Grid.Column="1" Grid.Row="1" BorderBrush="{x:Null}" DataContext="{Binding}" Foreground="{x:Null}" Name="buttonIconReplayPlay" Style="{DynamicResource InformButton}"   ToolTip="opens a file" Click="buttonIconReplayPlay_Click">
                <Button.Background>
                    <ImageBrush  RenderOptions.EdgeMode="Aliased" RenderOptions.BitmapScalingMode="HighQuality" ImageSource="/EITSurferInfinity;component/Icons/open64.png" />
                </Button.Background>
            </Button>
            <Button Content="Button" HorizontalAlignment="Stretch" Name="OpenContactElectrode" VerticalAlignment="Stretch" Grid.Row="2" Grid.Column="1" Click="OpenContactElectrode_Click" />
            <Button Content="save" HorizontalAlignment="Stretch" Name="SaveToFile" VerticalAlignment="Stretch" Grid.Row="3" Grid.Column="1" Click="SaveToFile_Click" />
            <Button Content="serial" HorizontalAlignment="Stretch" Name="Serial" VerticalAlignment="Stretch" Grid.Row="4" Grid.Column="1" Click="Serial_Click" />
            <Button Content="HW" HorizontalAlignment="Stretch" Name="SelctHw" VerticalAlignment="Stretch" Grid.Row="5" Grid.Column="1" Click="SelctHw_Click" />
            <Button Content="Clear" HorizontalAlignment="Stretch" Name="ClearData" VerticalAlignment="Stretch" Grid.Row="6" Grid.Column="1" Click="ClearData_Click" />
            <Button Content="Reset" HorizontalAlignment="Stretch" Name="Reset" VerticalAlignment="Stretch" Grid.Row="7" Grid.Column="1" Click="Reset_Click" />

            <!--<Button Content="Button" Grid.Column="1" Height="23" HorizontalAlignment="Left" Margin="0,14,0,0" Name="buttonIconReplayPlay" VerticalAlignment="Top" Width="75" Grid.Row="1" Click="buttonIconReplayPlay_Click" />
            <Button Content="Button" Grid.Column="1" Height="23" HorizontalAlignment="Left" Margin="1,15,0,0" Name="buttonIconReplayStop" VerticalAlignment="Top" Width="75" Grid.Row="2" Click="buttonIconReplayStop_Click" />
            <StackPanel Grid.Row="8" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">

                <ScrollViewer VerticalScrollBarVisibility="Auto" Height="200">

                    <StackPanel Height="Auto" x:Name="stackStores" Orientation="Vertical">

                        <Button Content="Disconnect" Height="24" HorizontalAlignment="Stretch"  Name="ButtonDisconnect" VerticalAlignment="Top" Click="ButtonDisconnect_Click" Focusable="False" />
                        <Button Content="Start Default" Height="24" HorizontalAlignment="Stretch"  Name="buttonStart" VerticalAlignment="Top"  Click="buttonStart_Click" Focusable="False" />
                        <Button Content="Stop Acquistion" Height="24" HorizontalAlignment="Stretch"  Name="buttonStop" VerticalAlignment="Top"  Click="buttonStop_Click" Focusable="False" />
                        <Button Content="clear" Height="24" HorizontalAlignment="Stretch" Name="button6" VerticalAlignment="Stretch"  Click="button6_Click" />
                        <Button Content="take Raw Snap Shot 100" Height="24" HorizontalAlignment="Stretch"  Name="button8" VerticalAlignment="Top"  Click="button8_Click" Grid.ColumnSpan="2" /> 
                        <Button Content="Protocol" Focusable="False" Height="24" HorizontalAlignment="Stretch" Name="buttonProtocol" VerticalAlignment="Top"  Click="buttonProtocol_Click" />
                        <Button Content="Enable Record" Height="24" HorizontalAlignment="Stretch"  Name="buttonEnableRecord" VerticalAlignment="Top"  Click="buttonEnableRecord_Click" Grid.ColumnSpan="2" />
                        <Button Content="Open Image" Height="24" HorizontalAlignment="Stretch"  Name="buttonReconstruction" VerticalAlignment="Top"  Click="buttonReconstruction_Click" /> 


                    </StackPanel>

                </ScrollViewer>

            </StackPanel> -->
        </Grid>
        <RichTextBox HorizontalAlignment="Stretch" Name="richTextBoxOut" VerticalAlignment="Stretch"  VerticalScrollBarVisibility="Auto" FontStretch="Normal" Grid.Column="2" Grid.ColumnSpan="3" />
    </Grid>

</Window>

